﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;
namespace Model
{
    [Serializable]
    public class ColumnDefine
    {
        [XmlAttribute("column")]
        public string Column { get; set; }
        [XmlAttribute("descript")]
        public string Descript { get; set; }
        [XmlIgnore]
        public object Value { get; set; }
        [XmlAttribute("name")]
        public string ControlName { get; set; }
        [XmlAttribute("type")]
        public DataType Type { get; set; }
         [XmlAttribute("default")]
        public string Default { get; set; }
        [XmlIgnore]
        public Type DbType { get;set;}

        public override string ToString()
        {
            if (Type == DataType.INT)
            {
                return string.Format("{0}{1}{2}", Column, "=", Value);
            }
            else
            {
                return string.Format("{0}{1}'{2}'", Column, "=", Value);
            }
        }
       
    }
    public enum DataType
    {
        INT,
        STRING

    }
}
